/*
 * Utility.h
 *
 *  Created on: 08/ott/2013
 *      Author: alessandrob
 */

#ifndef UTILITY_H_
#define UTILITY_H_
#include<iostream>
#include<arpa/inet.h>
#include<unistd.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<opencv2/opencv.hpp>
#include<opencv2/features2d/features2d.hpp>
#include<opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;

typedef struct broadcast_packet{
	int payloadDimension;
	int packetNumber;
	uchar serializedPacket[3000];
}broadcast_packet;

void unicast(int);
void broadcast(int);
void printErrorLog(string);
void deserializePackets(broadcast_packet[],int);
Mat buildImage(broadcast_packet[],int,int,int,int,int);
void orderPackets(broadcast_packet[],int);
void serializeKeypoints(vector<KeyPoint>,uchar*);
void sendData(int,double,int,vector<KeyPoint>,Mat);

#endif /* UTILITY_H_ */
